<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>v-bind动态绑定style(对象语法)</title>
    <script src="js/vue.min.js"></script>
</head>
<body>
<app id="app">

    <h2 :style="[baseStyle]">{{message}}</h2>
    <!-- 函数 -->
    <h2 :style="getStyle()">{{message}}</h2>

</app>
</body>
<script>
    const app = new Vue({
        el:"#app",
        data:{
            message:"你好啊",
            baseStyle:{backgroundColor:'red'}
        },
        methods: {
            getStyle(){
                return [this.baseStyle]
            }
        }
    });
</script>
</html>